<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Reference Section of Boost.Any</title>
<link rel="stylesheet" href="../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="any.html" title="Chapter 4. Boost.Any 1.2">
<link rel="prev" href="any/ValueType.html" title="ValueType requirements">
<link rel="next" href="boost/any.html" title="Class any">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../boost.png"></td>
<td align="center"><a href="../../index.html">Home</a></td>
<td align="center"><a href="../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="any/ValueType.html"><img src="../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="any.html"><img src="../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="boost/any.html"><img src="../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="reference_section_of_boost_any"></a>Reference Section of Boost.Any</h2></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="reference_section_of_boost_any.html#header.boost.any_hpp">Header &lt;boost/any.hpp&gt;</a></span></dt>
<dt><span class="section"><a href="reference_section_of_boost_any.html#header.boost.any.bad_any_cast_hpp">Header &lt;boost/any/bad_any_cast.hpp&gt;</a></span></dt>
<dt><span class="section"><a href="reference_section_of_boost_any.html#header.boost.any.basic_any_hpp">Header &lt;boost/any/basic_any.hpp&gt;</a></span></dt>
<dt><span class="section"><a href="reference_section_of_boost_any.html#header.boost.any.fwd_hpp">Header &lt;boost/any/fwd.hpp&gt;</a></span></dt>
<dt><span class="section"><a href="reference_section_of_boost_any.html#header.boost.any.unique_any_hpp">Header &lt;boost/any/unique_any.hpp&gt;</a></span></dt>
</dl></div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="header.boost.any_hpp"></a>Header &lt;<a href="https://www.boost.org/doc/libs/1_82_0/boost/any.hpp" target="_top">boost/any.hpp</a>&gt;</h3></div></div></div>
<p>A class whose instances can hold instances of any type that satisfies  <a class="link" href="any/ValueType.html" title="ValueType requirements"> ValueType </a> requirements.  </p>
<pre class="synopsis"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
  <span class="keyword">class</span> <a class="link" href="boost/any.html" title="Class any">any</a><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="boost/swap.html" title="Function swap"><span class="identifier">swap</span></a><span class="special">(</span><a class="link" href="boost/any.html" title="Class any">any</a> <span class="special">&amp;</span><span class="special">,</span> <a class="link" href="boost/any.html" title="Class any">any</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ValueType<span class="special">&gt;</span> <span class="identifier">ValueType</span> <span class="special">*</span> <a class="link" href="boost/any_cast_idm770.html" title="Function template any_cast"><span class="identifier">any_cast</span></a><span class="special">(</span><a class="link" href="boost/any.html" title="Class any">any</a> <span class="special">*</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ValueType<span class="special">&gt;</span> <span class="keyword">const</span> <span class="identifier">ValueType</span> <span class="special">*</span> <a class="link" href="boost/any_cast_idm784.html" title="Function template any_cast"><span class="identifier">any_cast</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="boost/any.html" title="Class any">any</a> <span class="special">*</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ValueType<span class="special">&gt;</span> <span class="identifier">ValueType</span> <a class="link" href="boost/any_cast_idm798.html" title="Function template any_cast"><span class="identifier">any_cast</span></a><span class="special">(</span><a class="link" href="boost/any.html" title="Class any">any</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ValueType<span class="special">&gt;</span> <span class="identifier">ValueType</span> <a class="link" href="boost/any_cast_idm814.html" title="Function template any_cast"><span class="identifier">any_cast</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="boost/any.html" title="Class any">any</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ValueType<span class="special">&gt;</span> <span class="identifier">ValueType</span> <a class="link" href="boost/any_cast_idm832.html" title="Function template any_cast"><span class="identifier">any_cast</span></a><span class="special">(</span><a class="link" href="boost/any.html" title="Class any">any</a> <span class="special">&amp;&amp;</span><span class="special">)</span><span class="special">;</span>
<span class="special">}</span></pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="header.boost.any.bad_any_cast_hpp"></a>Header &lt;<a href="https://www.boost.org/doc/libs/1_82_0/boost/any/bad_any_cast.hpp" target="_top">boost/any/bad_any_cast.hpp</a>&gt;</h3></div></div></div>
<pre class="synopsis"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
  <span class="keyword">class</span> <a class="link" href="boost/bad_any_cast.html" title="Class bad_any_cast">bad_any_cast</a><span class="special">;</span>
<span class="special">}</span></pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="header.boost.any.basic_any_hpp"></a>Header &lt;<a href="https://www.boost.org/doc/libs/1_82_0/boost/any/basic_any.hpp" target="_top">boost/any/basic_any.hpp</a>&gt;</h3></div></div></div>
<p>A class with customizable Small Object Optimization whose instances can hold instances of any type that satisfies  <a class="link" href="any/ValueType.html" title="ValueType requirements"> ValueType </a> requirements. Use <a class="link" href="boost/any.html" title="Class any">boost::any</a> instead if not sure.  </p>
<pre class="synopsis"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
  <span class="keyword">namespace</span> <span class="identifier">anys</span> <span class="special">{</span>
    <span class="keyword">template</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> OptimizeForSize<span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> OptimizeForAlignment<span class="special">&gt;</span> 
      <span class="keyword">class</span> <a class="link" href="boost/anys/basic_any.html" title="Class template basic_any">basic_any</a><span class="special">;</span>
    <span class="keyword">template</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> OptimizeForSize<span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> OptimizeForAlignment<span class="special">&gt;</span> 
      <span class="keyword">void</span> <a class="link" href="boost/anys/swap_idm1073.html" title="Function template swap"><span class="identifier">swap</span></a><span class="special">(</span><a class="link" href="boost/anys/basic_any.html" title="Class template basic_any">basic_any</a><span class="special">&lt;</span> <span class="identifier">OptimizeForSize</span><span class="special">,</span> <span class="identifier">OptimizeForAlignment</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">,</span> 
                <a class="link" href="boost/anys/basic_any.html" title="Class template basic_any">basic_any</a><span class="special">&lt;</span> <span class="identifier">OptimizeForSize</span><span class="special">,</span> <span class="identifier">OptimizeForAlignment</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
    <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ValueType<span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> Size<span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> Alignment<span class="special">&gt;</span> 
      <span class="identifier">ValueType</span> <span class="special">*</span> <a class="link" href="boost/anys/any_cast_idm1093.html" title="Function template any_cast"><span class="identifier">any_cast</span></a><span class="special">(</span><a class="link" href="boost/anys/basic_any.html" title="Class template basic_any">basic_any</a><span class="special">&lt;</span> <span class="identifier">Size</span><span class="special">,</span> <span class="identifier">Alignment</span> <span class="special">&gt;</span> <span class="special">*</span><span class="special">)</span><span class="special">;</span>
    <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ValueType<span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> OptimizeForSize<span class="special">,</span> 
             <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> OptimizeForAlignment<span class="special">&gt;</span> 
      <span class="keyword">const</span> <span class="identifier">ValueType</span> <span class="special">*</span> 
      <a class="link" href="boost/anys/any_cast_idm1111.html" title="Function template any_cast"><span class="identifier">any_cast</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="boost/anys/basic_any.html" title="Class template basic_any">basic_any</a><span class="special">&lt;</span> <span class="identifier">OptimizeForSize</span><span class="special">,</span> <span class="identifier">OptimizeForAlignment</span> <span class="special">&gt;</span> <span class="special">*</span><span class="special">)</span><span class="special">;</span>
    <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ValueType<span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> OptimizeForSize<span class="special">,</span> 
             <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> OptimizeForAlignment<span class="special">&gt;</span> 
      <span class="identifier">ValueType</span> <a class="link" href="boost/anys/any_cast_idm1129.html" title="Function template any_cast"><span class="identifier">any_cast</span></a><span class="special">(</span><a class="link" href="boost/anys/basic_any.html" title="Class template basic_any">basic_any</a><span class="special">&lt;</span> <span class="identifier">OptimizeForSize</span><span class="special">,</span> <span class="identifier">OptimizeForAlignment</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
    <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ValueType<span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> OptimizeForSize<span class="special">,</span> 
             <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> OptimizeForAlignment<span class="special">&gt;</span> 
      <span class="identifier">ValueType</span> <a class="link" href="boost/anys/any_cast_idm1149.html" title="Function template any_cast"><span class="identifier">any_cast</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="boost/anys/basic_any.html" title="Class template basic_any">basic_any</a><span class="special">&lt;</span> <span class="identifier">OptimizeForSize</span><span class="special">,</span> <span class="identifier">OptimizeForAlignment</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
    <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ValueType<span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> OptimizeForSize<span class="special">,</span> 
             <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> OptimizeForAlignment<span class="special">&gt;</span> 
      <span class="identifier">ValueType</span> <a class="link" href="boost/anys/any_cast_idm1171.html" title="Function template any_cast"><span class="identifier">any_cast</span></a><span class="special">(</span><a class="link" href="boost/anys/basic_any.html" title="Class template basic_any">basic_any</a><span class="special">&lt;</span> <span class="identifier">OptimizeForSize</span><span class="special">,</span> <span class="identifier">OptimizeForAlignment</span> <span class="special">&gt;</span> <span class="special">&amp;&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="special">}</span>
<span class="special">}</span></pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="header.boost.any.fwd_hpp"></a>Header &lt;<a href="https://www.boost.org/doc/libs/1_82_0/boost/any/fwd.hpp" target="_top">boost/any/fwd.hpp</a>&gt;</h3></div></div></div>
<p>Forward declarations of Boost.Any library types. </p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="header.boost.any.unique_any_hpp"></a>Header &lt;<a href="https://www.boost.org/doc/libs/1_82_0/boost/any/unique_any.hpp" target="_top">boost/any/unique_any.hpp</a>&gt;</h3></div></div></div>
<p>A class whose instances can hold instances of any type (including non-copyable and non-movable types).  </p>
<pre class="synopsis"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
  <span class="keyword">namespace</span> <span class="identifier">anys</span> <span class="special">{</span>
    <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> <span class="keyword">struct</span> <a class="link" href="boost/anys/in_place_type_t.html" title="Struct template in_place_type_t">in_place_type_t</a><span class="special">;</span>

    <span class="keyword">class</span> <a class="link" href="boost/anys/unique_any.html" title="Class unique_any">unique_any</a><span class="special">;</span>

    <span class="keyword">constexpr</span> <a class="link" href="boost/anys/in_place_type_t.html" title="Struct template in_place_type_t">in_place_type_t</a><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> <a class="link" href="boost/anys/in_place_type.html" title="Global in_place_type">in_place_type</a><span class="special">;</span>
    <span class="keyword">void</span> <a class="link" href="boost/anys/swap_idm1438.html" title="Function swap"><span class="identifier">swap</span></a><span class="special">(</span><a class="link" href="boost/anys/unique_any.html" title="Class unique_any">unique_any</a> <span class="special">&amp;</span><span class="special">,</span> <a class="link" href="boost/anys/unique_any.html" title="Class unique_any">unique_any</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
    <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> <span class="identifier">T</span> <span class="special">*</span> <a class="link" href="boost/anys/any_cast_idm1453.html" title="Function template any_cast"><span class="identifier">any_cast</span></a><span class="special">(</span><a class="link" href="boost/anys/unique_any.html" title="Class unique_any">unique_any</a> <span class="special">*</span><span class="special">)</span><span class="special">;</span>
    <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> <span class="keyword">const</span> <span class="identifier">T</span> <span class="special">*</span> <a class="link" href="boost/anys/any_cast_idm1468.html" title="Function template any_cast"><span class="identifier">any_cast</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="boost/anys/unique_any.html" title="Class unique_any">unique_any</a> <span class="special">*</span><span class="special">)</span><span class="special">;</span>
    <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> <span class="identifier">T</span> <a class="link" href="boost/anys/any_cast_idm1483.html" title="Function template any_cast"><span class="identifier">any_cast</span></a><span class="special">(</span><a class="link" href="boost/anys/unique_any.html" title="Class unique_any">unique_any</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
    <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> <span class="identifier">T</span> <a class="link" href="boost/anys/any_cast_idm1501.html" title="Function template any_cast"><span class="identifier">any_cast</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="boost/anys/unique_any.html" title="Class unique_any">unique_any</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
    <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> <span class="identifier">T</span> <a class="link" href="boost/anys/any_cast_idm1519.html" title="Function template any_cast"><span class="identifier">any_cast</span></a><span class="special">(</span><a class="link" href="boost/anys/unique_any.html" title="Class unique_any">unique_any</a> <span class="special">&amp;&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="special">}</span>
<span class="special">}</span></pre>
</div>
</div>
<div class="copyright-footer">Copyright © 2001 Kevlin Henney<br>Copyright © 2013-2023 Antony Polukhin<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="any/ValueType.html"><img src="../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="any.html"><img src="../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="boost/any.html"><img src="../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
